﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace Poke_Tactics.Cenas
{
    class Main_Menu
    {
        Texture2D background;
        ContentManager Content;
        Button start_game, credits;

        public List<Button> listaBotoes = new List<Button>();

        public Main_Menu(GameWindow Window, ContentManager Content)
        {

            this.background = Content.Load<Texture2D>("logo-poke");
            this.Content = Content;

            start_game = new Button(Window, Content.Load<Texture2D>("start_game"));
            start_game.position = new Vector2(300, 250);
            start_game.isVisible = true;
            listaBotoes.Add(start_game);

            credits = new Button(Window, Content.Load<Texture2D>("credits"));
            credits.position = new Vector2(300, 350);
            credits.isVisible = true;
            listaBotoes.Add(credits);

        }

        public void Update(GameTime gameTime, KeyboardState keyboard, KeyboardState old_keyboard, MouseState mouse, MouseState old_mouse)
        {

            foreach (Button botao in listaBotoes)
            {
                botao.Update(gameTime, new Vector2(mouse.X, mouse.Y), mouse, old_mouse);
            }

            if (start_game.isClicked)
            {
                Game1.cena_atual = Game1.cenas.CENA_INTRO_1;
                start_game.isClicked = false;
            }

        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {

            spriteBatch.Draw(background,new Rectangle(300,0,background.Width,background.Height),Color.White);
            foreach (Button botao in listaBotoes)
            {
                botao.Draw(gameTime, spriteBatch);
            }

        }

    }
}
